{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "import nibabel as nii\n",
    "import numpy as np\n",
    "import os\n",
    "import tqdm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "predict_paths = ['/home/dlachinov/brats2019/data/predicts/2018',\n",
    "                '/home/dlachinov/brats2019/data/predicts/020',\n",
    "                '/home/dlachinov/brats2019/data/predicts/023',\n",
    "                '/home/dlachinov/brats2019/data/predicts/isensee_2018',\n",
    "                '/home/dlachinov/brats2019/data/predicts/030',\n",
    "                '/home/dlachinov/brats2019/data/predicts/031']\n",
    "output_path = '/home/dlachinov/brats2019/data/predicts/average'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "800\n"
     ]
    }
   ],
   "source": [
    "file_list = os.listdir(predict_paths[0])\n",
    "print(len(file_list))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "  0%|          | 0/800 [00:00<?, ?it/s]\u001b[A\n",
      "  0%|          | 1/800 [00:02<30:39,  2.30s/it]\u001b[A\n",
      "  0%|          | 2/800 [00:04<30:12,  2.27s/it]\u001b[A\n",
      "  0%|          | 3/800 [00:06<30:00,  2.26s/it]\u001b[A\n",
      "  0%|          | 4/800 [00:09<33:29,  2.53s/it]\u001b[A\n",
      "  1%|          | 5/800 [00:12<31:53,  2.41s/it]\u001b[A\n",
      "  1%|          | 6/800 [00:15<35:01,  2.65s/it]\u001b[A\n",
      "  1%|          | 7/800 [00:18<37:45,  2.86s/it]\u001b[A\n",
      "  1%|          | 8/800 [00:20<34:56,  2.65s/it]\u001b[A\n",
      "  1%|          | 9/800 [00:22<33:24,  2.53s/it]\u001b[A\n",
      "  1%|▏         | 10/800 [00:25<31:37,  2.40s/it]\u001b[A\n",
      "  1%|▏         | 11/800 [00:28<35:47,  2.72s/it]\u001b[A\n",
      "  2%|▏         | 12/800 [00:30<33:30,  2.55s/it]\u001b[A\n",
      "  2%|▏         | 13/800 [00:34<36:27,  2.78s/it]\u001b[A\n",
      "  2%|▏         | 14/800 [00:36<33:49,  2.58s/it]\u001b[A\n",
      "  2%|▏         | 15/800 [00:38<32:12,  2.46s/it]\u001b[A\n",
      "  2%|▏         | 16/800 [00:40<31:15,  2.39s/it]\u001b[A\n",
      "  2%|▏         | 17/800 [00:42<30:01,  2.30s/it]\u001b[A\n",
      "  2%|▏         | 18/800 [00:45<33:29,  2.57s/it]\u001b[A\n",
      "  2%|▏         | 19/800 [00:48<32:41,  2.51s/it]\u001b[A\n",
      "  2%|▎         | 20/800 [00:50<31:51,  2.45s/it]\u001b[A\n",
      "  3%|▎         | 21/800 [00:52<30:31,  2.35s/it]\u001b[A\n",
      "  3%|▎         | 22/800 [00:54<30:00,  2.31s/it]\u001b[A\n",
      "  3%|▎         | 23/800 [00:57<29:51,  2.31s/it]\u001b[A\n",
      "  3%|▎         | 24/800 [00:59<29:27,  2.28s/it]\u001b[A\n",
      "  3%|▎         | 25/800 [01:02<33:10,  2.57s/it]\u001b[A\n",
      "  3%|▎         | 26/800 [01:04<31:57,  2.48s/it]\u001b[A\n",
      "  3%|▎         | 27/800 [01:06<30:32,  2.37s/it]\u001b[A\n",
      "  4%|▎         | 28/800 [01:10<33:35,  2.61s/it]\u001b[A\n",
      "  4%|▎         | 29/800 [01:12<32:07,  2.50s/it]\u001b[A\n",
      "  4%|▍         | 30/800 [01:14<31:13,  2.43s/it]\u001b[A\n",
      "  4%|▍         | 31/800 [01:16<30:24,  2.37s/it]\u001b[A\n",
      "  4%|▍         | 32/800 [01:20<33:23,  2.61s/it]\u001b[A\n",
      "  4%|▍         | 33/800 [01:22<32:10,  2.52s/it]\u001b[A\n",
      "  4%|▍         | 34/800 [01:25<35:21,  2.77s/it]\u001b[A\n",
      "  4%|▍         | 35/800 [01:28<37:03,  2.91s/it]\u001b[A\n",
      "  4%|▍         | 36/800 [01:32<38:38,  3.03s/it]\u001b[A\n",
      "  5%|▍         | 37/800 [01:34<35:28,  2.79s/it]\u001b[A\n",
      "  5%|▍         | 38/800 [01:36<33:25,  2.63s/it]\u001b[A\n",
      "  5%|▍         | 39/800 [01:39<35:27,  2.80s/it]\u001b[A\n",
      "  5%|▌         | 40/800 [01:42<33:42,  2.66s/it]\u001b[A\n",
      "  5%|▌         | 41/800 [01:44<31:49,  2.52s/it]\u001b[A\n",
      "  5%|▌         | 42/800 [01:46<30:08,  2.39s/it]\u001b[A\n",
      "  5%|▌         | 43/800 [01:48<29:32,  2.34s/it]\u001b[A\n",
      "  6%|▌         | 44/800 [01:52<33:23,  2.65s/it]\u001b[A\n",
      "  6%|▌         | 45/800 [01:54<32:19,  2.57s/it]\u001b[A\n",
      "  6%|▌         | 46/800 [01:57<34:56,  2.78s/it]\u001b[A\n",
      "  6%|▌         | 47/800 [02:00<32:56,  2.62s/it]\u001b[A\n",
      "  6%|▌         | 48/800 [02:02<31:32,  2.52s/it]\u001b[A\n",
      "  6%|▌         | 49/800 [02:04<30:31,  2.44s/it]\u001b[A\n",
      "  6%|▋         | 50/800 [02:06<29:01,  2.32s/it]\u001b[A\n",
      "  6%|▋         | 51/800 [02:09<32:20,  2.59s/it]\u001b[A\n",
      "  6%|▋         | 52/800 [02:12<30:55,  2.48s/it]\u001b[A\n",
      "  7%|▋         | 53/800 [02:14<29:45,  2.39s/it]\u001b[A\n",
      "  7%|▋         | 54/800 [02:16<28:53,  2.32s/it]\u001b[A\n",
      "  7%|▋         | 55/800 [02:19<31:38,  2.55s/it]\u001b[A\n",
      "  7%|▋         | 56/800 [02:22<33:51,  2.73s/it]\u001b[A\n",
      "  7%|▋         | 57/800 [02:24<32:09,  2.60s/it]\u001b[A\n",
      "  7%|▋         | 58/800 [02:27<30:56,  2.50s/it]\u001b[A\n",
      "  7%|▋         | 59/800 [02:30<32:53,  2.66s/it]\u001b[A\n",
      "  8%|▊         | 60/800 [02:32<31:19,  2.54s/it]\u001b[A\n",
      "  8%|▊         | 61/800 [02:35<33:39,  2.73s/it]\u001b[A\n",
      "  8%|▊         | 62/800 [02:37<31:48,  2.59s/it]\u001b[A\n",
      "  8%|▊         | 63/800 [02:41<34:40,  2.82s/it]\u001b[A\n",
      "  8%|▊         | 64/800 [02:43<32:47,  2.67s/it]\u001b[A\n",
      "  8%|▊         | 65/800 [02:46<31:41,  2.59s/it]\u001b[A\n",
      "  8%|▊         | 66/800 [02:48<30:45,  2.51s/it]\u001b[A\n",
      "  8%|▊         | 67/800 [02:50<30:03,  2.46s/it]\u001b[A\n",
      "  8%|▊         | 68/800 [02:52<29:00,  2.38s/it]\u001b[A\n",
      "  9%|▊         | 69/800 [02:55<28:24,  2.33s/it]\u001b[A\n",
      "  9%|▉         | 70/800 [02:58<32:15,  2.65s/it]\u001b[A\n",
      "  9%|▉         | 71/800 [03:01<34:34,  2.85s/it]\u001b[A\n",
      "  9%|▉         | 72/800 [03:04<32:57,  2.72s/it]\u001b[A\n",
      "  9%|▉         | 73/800 [03:06<31:40,  2.61s/it]\u001b[A\n",
      "  9%|▉         | 74/800 [03:08<30:32,  2.52s/it]\u001b[A\n",
      "  9%|▉         | 75/800 [03:11<30:14,  2.50s/it]\u001b[A\n",
      " 10%|▉         | 76/800 [03:14<32:25,  2.69s/it]\u001b[A\n",
      " 10%|▉         | 77/800 [03:17<35:11,  2.92s/it]\u001b[A\n",
      " 10%|▉         | 78/800 [03:20<32:54,  2.74s/it]\u001b[A\n",
      " 10%|▉         | 79/800 [03:23<34:23,  2.86s/it]\u001b[A\n",
      " 10%|█         | 80/800 [03:25<31:58,  2.66s/it]\u001b[A\n",
      " 10%|█         | 81/800 [03:28<34:11,  2.85s/it]\u001b[A\n",
      " 10%|█         | 82/800 [03:31<32:14,  2.69s/it]\u001b[A\n",
      " 10%|█         | 83/800 [03:33<30:57,  2.59s/it]\u001b[A\n",
      " 10%|█         | 84/800 [03:35<29:42,  2.49s/it]\u001b[A\n",
      " 11%|█         | 85/800 [03:39<32:47,  2.75s/it]\u001b[A\n",
      " 11%|█         | 86/800 [03:41<30:51,  2.59s/it]\u001b[A\n",
      " 11%|█         | 87/800 [03:43<29:32,  2.49s/it]\u001b[A\n",
      " 11%|█         | 88/800 [03:47<32:45,  2.76s/it]\u001b[A\n",
      " 11%|█         | 89/800 [03:49<31:12,  2.63s/it]\u001b[A\n",
      " 11%|█▏        | 90/800 [03:51<29:53,  2.53s/it]\u001b[A\n",
      " 11%|█▏        | 91/800 [03:55<32:51,  2.78s/it]\u001b[A\n",
      " 12%|█▏        | 92/800 [03:57<31:31,  2.67s/it]\u001b[A\n",
      " 12%|█▏        | 93/800 [03:59<30:12,  2.56s/it]\u001b[A\n",
      " 12%|█▏        | 94/800 [04:03<32:32,  2.76s/it]\u001b[A\n",
      " 12%|█▏        | 95/800 [04:06<34:19,  2.92s/it]\u001b[A\n",
      " 12%|█▏        | 96/800 [04:08<31:58,  2.72s/it]\u001b[A\n",
      " 12%|█▏        | 97/800 [04:10<30:41,  2.62s/it]\u001b[A\n",
      " 12%|█▏        | 98/800 [04:13<28:43,  2.46s/it]\u001b[A\n",
      " 12%|█▏        | 99/800 [04:15<27:29,  2.35s/it]\u001b[A\n",
      " 12%|█▎        | 100/800 [04:18<30:53,  2.65s/it]\u001b[A\n",
      " 13%|█▎        | 101/800 [04:21<33:17,  2.86s/it]\u001b[A\n",
      " 13%|█▎        | 102/800 [04:24<31:10,  2.68s/it]\u001b[A\n",
      " 13%|█▎        | 103/800 [04:27<33:14,  2.86s/it]\u001b[A\n",
      " 13%|█▎        | 104/800 [04:30<34:53,  3.01s/it]\u001b[A\n",
      " 13%|█▎        | 105/800 [04:32<32:05,  2.77s/it]\u001b[A\n",
      " 13%|█▎        | 106/800 [04:36<34:11,  2.96s/it]\u001b[A\n",
      " 13%|█▎        | 107/800 [04:38<31:53,  2.76s/it]\u001b[A\n",
      " 14%|█▎        | 108/800 [04:40<30:03,  2.61s/it]\u001b[A\n",
      " 14%|█▎        | 109/800 [04:43<28:25,  2.47s/it]\u001b[A\n",
      " 14%|█▍        | 110/800 [04:46<30:55,  2.69s/it]\u001b[A\n",
      " 14%|█▍        | 111/800 [04:48<29:22,  2.56s/it]\u001b[A\n",
      " 14%|█▍        | 112/800 [04:51<32:04,  2.80s/it]\u001b[A\n",
      " 14%|█▍        | 113/800 [04:55<33:46,  2.95s/it]\u001b[A\n",
      " 14%|█▍        | 114/800 [04:57<31:13,  2.73s/it]\u001b[A\n",
      " 14%|█▍        | 115/800 [04:59<29:39,  2.60s/it]\u001b[A\n",
      " 14%|█▍        | 116/800 [05:01<28:24,  2.49s/it]\u001b[A\n",
      " 15%|█▍        | 117/800 [05:04<27:32,  2.42s/it]\u001b[A\n",
      " 15%|█▍        | 118/800 [05:06<26:53,  2.37s/it]\u001b[A\n",
      " 15%|█▍        | 119/800 [05:08<26:34,  2.34s/it]\u001b[A\n",
      " 15%|█▌        | 120/800 [05:10<26:26,  2.33s/it]\u001b[A\n",
      " 15%|█▌        | 121/800 [05:13<25:52,  2.29s/it]\u001b[A\n",
      " 15%|█▌        | 122/800 [05:15<25:37,  2.27s/it]\u001b[A\n",
      " 15%|█▌        | 123/800 [05:18<29:04,  2.58s/it]\u001b[A\n",
      " 16%|█▌        | 124/800 [05:21<31:02,  2.75s/it]\u001b[A\n",
      " 16%|█▌        | 125/800 [05:25<32:19,  2.87s/it]\u001b[A\n",
      " 16%|█▌        | 126/800 [05:27<30:41,  2.73s/it]\u001b[A\n",
      " 16%|█▌        | 127/800 [05:29<28:52,  2.57s/it]\u001b[A\n",
      " 16%|█▌        | 128/800 [05:31<27:07,  2.42s/it]\u001b[A\n",
      " 16%|█▌        | 129/800 [05:34<30:02,  2.69s/it]\u001b[A\n",
      " 16%|█▋        | 130/800 [05:37<28:39,  2.57s/it]\u001b[A\n",
      " 16%|█▋        | 131/800 [05:40<31:00,  2.78s/it]\u001b[A\n",
      " 16%|█▋        | 132/800 [05:43<33:07,  2.98s/it]\u001b[A\n",
      " 17%|█▋        | 133/800 [05:46<30:48,  2.77s/it]\u001b[A\n",
      " 17%|█▋        | 134/800 [05:48<29:18,  2.64s/it]\u001b[A\n",
      " 17%|█▋        | 135/800 [05:51<31:37,  2.85s/it]\u001b[A\n",
      " 17%|█▋        | 136/800 [05:55<33:31,  3.03s/it]\u001b[A\n",
      " 17%|█▋        | 137/800 [05:57<31:10,  2.82s/it]\u001b[A\n",
      " 17%|█▋        | 138/800 [06:01<33:00,  2.99s/it]\u001b[A\n",
      " 17%|█▋        | 139/800 [06:04<33:52,  3.08s/it]\u001b[A\n",
      " 18%|█▊        | 140/800 [06:07<34:24,  3.13s/it]\u001b[A\n",
      " 18%|█▊        | 141/800 [06:09<31:41,  2.89s/it]\u001b[A\n",
      " 18%|█▊        | 142/800 [06:12<29:12,  2.66s/it]\u001b[A\n",
      " 18%|█▊        | 143/800 [06:14<27:28,  2.51s/it]\u001b[A\n",
      " 18%|█▊        | 144/800 [06:16<26:24,  2.42s/it]\u001b[A\n",
      " 18%|█▊        | 145/800 [06:18<25:50,  2.37s/it]\u001b[A\n",
      " 18%|█▊        | 146/800 [06:21<25:36,  2.35s/it]\u001b[A\n",
      " 18%|█▊        | 147/800 [06:23<25:21,  2.33s/it]\u001b[A\n",
      " 18%|█▊        | 148/800 [06:26<28:14,  2.60s/it]\u001b[A\n",
      " 19%|█▊        | 149/800 [06:28<27:06,  2.50s/it]\u001b[A\n",
      " 19%|█▉        | 150/800 [06:31<29:06,  2.69s/it]\u001b[A\n",
      " 19%|█▉        | 151/800 [06:34<27:38,  2.56s/it]\u001b[A\n",
      " 19%|█▉        | 152/800 [06:37<30:39,  2.84s/it]\u001b[A\n",
      " 19%|█▉        | 153/800 [06:40<28:58,  2.69s/it]\u001b[A\n",
      " 19%|█▉        | 154/800 [06:43<30:48,  2.86s/it]\u001b[A\n",
      " 19%|█▉        | 155/800 [06:45<29:00,  2.70s/it]\u001b[A\n",
      " 20%|█▉        | 156/800 [06:47<27:58,  2.61s/it]\u001b[A\n",
      " 20%|█▉        | 157/800 [06:50<27:05,  2.53s/it]\u001b[A\n",
      " 20%|█▉        | 158/800 [06:52<26:13,  2.45s/it]\u001b[A\n",
      " 20%|█▉        | 159/800 [06:54<25:10,  2.36s/it]\u001b[A\n",
      " 20%|██        | 160/800 [06:56<24:23,  2.29s/it]\u001b[A\n",
      " 20%|██        | 161/800 [07:00<27:43,  2.60s/it]\u001b[A\n",
      " 20%|██        | 162/800 [07:02<26:26,  2.49s/it]\u001b[A\n",
      " 20%|██        | 163/800 [07:05<28:43,  2.71s/it]\u001b[A\n",
      " 20%|██        | 164/800 [07:08<30:16,  2.86s/it]\u001b[A\n",
      " 21%|██        | 165/800 [07:11<28:37,  2.71s/it]\u001b[A\n",
      " 21%|██        | 166/800 [07:13<27:32,  2.61s/it]\u001b[A\n",
      " 21%|██        | 167/800 [07:15<26:20,  2.50s/it]\u001b[A\n",
      " 21%|██        | 168/800 [07:19<28:58,  2.75s/it]\u001b[A\n",
      " 21%|██        | 169/800 [07:21<27:26,  2.61s/it]\u001b[A\n",
      " 21%|██▏       | 170/800 [07:23<26:29,  2.52s/it]\u001b[A\n",
      " 21%|██▏       | 171/800 [07:26<25:41,  2.45s/it]\u001b[A\n",
      " 22%|██▏       | 172/800 [07:29<28:00,  2.68s/it]\u001b[A\n",
      " 22%|██▏       | 173/800 [07:31<26:44,  2.56s/it]\u001b[A\n",
      " 22%|██▏       | 174/800 [07:33<25:35,  2.45s/it]\u001b[A\n",
      " 22%|██▏       | 175/800 [07:36<24:58,  2.40s/it]\u001b[A\n",
      " 22%|██▏       | 176/800 [07:39<27:42,  2.66s/it]\u001b[A\n",
      " 22%|██▏       | 177/800 [07:41<26:30,  2.55s/it]\u001b[A\n",
      " 22%|██▏       | 178/800 [07:44<28:23,  2.74s/it]\u001b[A\n",
      " 22%|██▏       | 179/800 [07:47<29:46,  2.88s/it]\u001b[A\n",
      " 22%|██▎       | 180/800 [07:51<31:37,  3.06s/it]\u001b[A\n",
      " 23%|██▎       | 181/800 [07:54<32:26,  3.14s/it]\u001b[A\n",
      " 23%|██▎       | 182/800 [07:57<29:33,  2.87s/it]\u001b[A\n",
      " 23%|██▎       | 183/800 [08:00<30:51,  3.00s/it]\u001b[A\n",
      " 23%|██▎       | 184/800 [08:03<31:53,  3.11s/it]\u001b[A\n",
      " 23%|██▎       | 185/800 [08:07<33:10,  3.24s/it]\u001b[A\n",
      " 23%|██▎       | 186/800 [08:10<33:25,  3.27s/it]\u001b[A\n",
      " 23%|██▎       | 187/800 [08:13<33:48,  3.31s/it]\u001b[A\n",
      " 24%|██▎       | 188/800 [08:17<34:15,  3.36s/it]\u001b[A\n",
      " 24%|██▎       | 189/800 [08:19<30:58,  3.04s/it]\u001b[A\n",
      " 24%|██▍       | 190/800 [08:21<28:12,  2.77s/it]\u001b[A\n",
      " 24%|██▍       | 191/800 [08:24<26:29,  2.61s/it]\u001b[A\n",
      " 24%|██▍       | 192/800 [08:26<25:16,  2.49s/it]\u001b[A\n",
      " 24%|██▍       | 193/800 [08:28<25:05,  2.48s/it]\u001b[A\n",
      " 24%|██▍       | 194/800 [08:31<24:20,  2.41s/it]\u001b[A\n",
      " 24%|██▍       | 195/800 [08:34<27:58,  2.77s/it]\u001b[A\n",
      " 24%|██▍       | 196/800 [08:36<26:34,  2.64s/it]\u001b[A\n",
      " 25%|██▍       | 197/800 [08:40<28:26,  2.83s/it]\u001b[A\n",
      " 25%|██▍       | 198/800 [08:42<26:56,  2.69s/it]\u001b[A\n",
      " 25%|██▍       | 199/800 [08:44<25:42,  2.57s/it]\u001b[A\n",
      " 25%|██▌       | 200/800 [08:48<27:43,  2.77s/it]\u001b[A\n",
      " 25%|██▌       | 201/800 [08:51<29:42,  2.98s/it]\u001b[A\n",
      " 25%|██▌       | 202/800 [08:54<30:53,  3.10s/it]\u001b[A\n",
      " 25%|██▌       | 203/800 [08:57<28:26,  2.86s/it]\u001b[A\n",
      " 26%|██▌       | 204/800 [08:59<26:50,  2.70s/it]\u001b[A\n",
      " 26%|██▌       | 205/800 [09:01<25:39,  2.59s/it]\u001b[A\n",
      " 26%|██▌       | 206/800 [09:04<24:26,  2.47s/it]\u001b[A\n",
      " 26%|██▌       | 207/800 [09:06<24:08,  2.44s/it]\u001b[A\n",
      " 26%|██▌       | 208/800 [09:10<27:14,  2.76s/it]\u001b[A\n",
      " 26%|██▌       | 209/800 [09:12<25:39,  2.61s/it]\u001b[A\n",
      " 26%|██▋       | 210/800 [09:14<24:24,  2.48s/it]\u001b[A\n",
      " 26%|██▋       | 211/800 [09:16<23:53,  2.43s/it]\u001b[A\n",
      " 26%|██▋       | 212/800 [09:20<26:28,  2.70s/it]\u001b[A\n",
      " 27%|██▋       | 213/800 [09:23<28:32,  2.92s/it]\u001b[A\n",
      " 27%|██▋       | 214/800 [09:26<29:54,  3.06s/it]\u001b[A\n",
      " 27%|██▋       | 215/800 [09:29<27:30,  2.82s/it]\u001b[A\n",
      " 27%|██▋       | 216/800 [09:32<29:15,  3.01s/it]\u001b[A\n",
      " 27%|██▋       | 217/800 [09:35<27:24,  2.82s/it]\u001b[A\n",
      " 27%|██▋       | 218/800 [09:37<25:41,  2.65s/it]\u001b[A\n",
      " 27%|██▋       | 219/800 [09:39<24:41,  2.55s/it]\u001b[A\n",
      " 28%|██▊       | 220/800 [09:41<23:51,  2.47s/it]\u001b[A\n",
      " 28%|██▊       | 221/800 [09:45<26:28,  2.74s/it]\u001b[A\n",
      " 28%|██▊       | 222/800 [09:47<25:06,  2.61s/it]\u001b[A\n",
      " 28%|██▊       | 223/800 [09:50<27:08,  2.82s/it]\u001b[A\n",
      " 28%|██▊       | 224/800 [09:54<28:08,  2.93s/it]\u001b[A\n",
      " 28%|██▊       | 225/800 [09:56<26:35,  2.77s/it]\u001b[A\n",
      " 28%|██▊       | 226/800 [09:58<25:00,  2.61s/it]\u001b[A\n",
      " 28%|██▊       | 227/800 [10:00<24:03,  2.52s/it]\u001b[A\n",
      " 28%|██▊       | 228/800 [10:04<26:42,  2.80s/it]\u001b[A\n",
      " 29%|██▊       | 229/800 [10:06<24:59,  2.63s/it]\u001b[A\n",
      " 29%|██▉       | 230/800 [10:08<23:56,  2.52s/it]\u001b[A\n",
      " 29%|██▉       | 231/800 [10:11<25:06,  2.65s/it]\u001b[A\n",
      " 29%|██▉       | 232/800 [10:15<27:17,  2.88s/it]\u001b[A\n",
      " 29%|██▉       | 233/800 [10:18<28:57,  3.07s/it]\u001b[A\n",
      " 29%|██▉       | 234/800 [10:21<26:38,  2.82s/it]\u001b[A\n",
      " 29%|██▉       | 235/800 [10:24<27:55,  2.97s/it]\u001b[A\n",
      " 30%|██▉       | 236/800 [10:26<25:57,  2.76s/it]\u001b[A\n",
      " 30%|██▉       | 237/800 [10:28<24:39,  2.63s/it]\u001b[A\n",
      " 30%|██▉       | 238/800 [10:32<26:32,  2.83s/it]\u001b[A\n",
      " 30%|██▉       | 239/800 [10:34<24:55,  2.67s/it]\u001b[A\n",
      " 30%|███       | 240/800 [10:36<23:33,  2.52s/it]\u001b[A\n",
      " 30%|███       | 241/800 [10:38<22:29,  2.41s/it]\u001b[A\n",
      " 30%|███       | 242/800 [10:41<22:10,  2.38s/it]\u001b[A\n",
      " 30%|███       | 243/800 [10:44<24:56,  2.69s/it]\u001b[A\n",
      " 30%|███       | 244/800 [10:46<23:37,  2.55s/it]\u001b[A\n",
      " 31%|███       | 245/800 [10:49<22:39,  2.45s/it]\u001b[A\n",
      " 31%|███       | 246/800 [10:52<24:28,  2.65s/it]\u001b[A\n",
      " 31%|███       | 247/800 [10:55<26:25,  2.87s/it]\u001b[A\n",
      " 31%|███       | 248/800 [10:57<24:51,  2.70s/it]\u001b[A\n",
      " 31%|███       | 249/800 [11:01<26:32,  2.89s/it]\u001b[A\n",
      " 31%|███▏      | 250/800 [11:03<24:56,  2.72s/it]\u001b[A\n",
      " 31%|███▏      | 251/800 [11:06<26:14,  2.87s/it]\u001b[A\n",
      " 32%|███▏      | 252/800 [11:10<27:27,  3.01s/it]\u001b[A\n",
      " 32%|███▏      | 253/800 [11:12<25:24,  2.79s/it]\u001b[A\n",
      " 32%|███▏      | 254/800 [11:14<23:56,  2.63s/it]\u001b[A\n",
      " 32%|███▏      | 255/800 [11:17<25:57,  2.86s/it]\u001b[A\n",
      " 32%|███▏      | 256/800 [11:21<27:11,  3.00s/it]\u001b[A\n",
      " 32%|███▏      | 257/800 [11:23<24:47,  2.74s/it]\u001b[A\n",
      " 32%|███▏      | 258/800 [11:25<23:49,  2.64s/it]\u001b[A\n",
      " 32%|███▏      | 259/800 [11:28<23:04,  2.56s/it]\u001b[A\n",
      " 32%|███▎      | 260/800 [11:31<25:11,  2.80s/it]\u001b[A\n",
      " 33%|███▎      | 261/800 [11:34<26:36,  2.96s/it]\u001b[A\n",
      " 33%|███▎      | 262/800 [11:37<25:03,  2.79s/it]\u001b[A\n",
      " 33%|███▎      | 263/800 [11:39<23:26,  2.62s/it]\u001b[A\n",
      " 33%|███▎      | 264/800 [11:42<25:09,  2.82s/it]\u001b[A\n",
      " 33%|███▎      | 265/800 [11:45<23:40,  2.66s/it]\u001b[A\n",
      " 33%|███▎      | 266/800 [11:47<22:42,  2.55s/it]\u001b[A\n",
      " 33%|███▎      | 267/800 [11:49<21:59,  2.47s/it]\u001b[A\n",
      " 34%|███▎      | 268/800 [11:51<21:28,  2.42s/it]\u001b[A\n",
      " 34%|███▎      | 269/800 [11:54<21:14,  2.40s/it]\u001b[A\n",
      " 34%|███▍      | 270/800 [11:56<20:42,  2.35s/it]\u001b[A\n",
      " 34%|███▍      | 271/800 [11:58<20:31,  2.33s/it]\u001b[A\n",
      " 34%|███▍      | 272/800 [12:02<23:24,  2.66s/it]\u001b[A\n",
      " 34%|███▍      | 273/800 [12:05<25:11,  2.87s/it]\u001b[A\n",
      " 34%|███▍      | 274/800 [12:07<23:48,  2.72s/it]\u001b[A\n",
      " 34%|███▍      | 275/800 [12:10<22:11,  2.54s/it]\u001b[A\n",
      " 34%|███▍      | 276/800 [12:13<24:16,  2.78s/it]\u001b[A\n",
      " 35%|███▍      | 277/800 [12:15<23:02,  2.64s/it]\u001b[A\n",
      " 35%|███▍      | 278/800 [12:19<24:36,  2.83s/it]\u001b[A\n",
      " 35%|███▍      | 279/800 [12:21<23:06,  2.66s/it]\u001b[A\n",
      " 35%|███▌      | 280/800 [12:24<24:27,  2.82s/it]\u001b[A\n",
      " 35%|███▌      | 281/800 [12:27<25:27,  2.94s/it]\u001b[A\n",
      " 35%|███▌      | 282/800 [12:30<23:41,  2.74s/it]\u001b[A\n",
      " 35%|███▌      | 283/800 [12:33<25:25,  2.95s/it]\u001b[A\n",
      " 36%|███▌      | 284/800 [12:35<23:33,  2.74s/it]\u001b[A\n",
      " 36%|███▌      | 285/800 [12:38<22:23,  2.61s/it]\u001b[A\n",
      " 36%|███▌      | 286/800 [12:40<21:52,  2.55s/it]\u001b[A\n",
      " 36%|███▌      | 287/800 [12:42<20:59,  2.45s/it]\u001b[A\n",
      " 36%|███▌      | 288/800 [12:45<22:58,  2.69s/it]\u001b[A\n",
      " 36%|███▌      | 289/800 [12:48<21:40,  2.54s/it]\u001b[A\n",
      " 36%|███▋      | 290/800 [12:50<20:39,  2.43s/it]\u001b[A\n",
      " 36%|███▋      | 291/800 [12:52<20:01,  2.36s/it]\u001b[A\n",
      " 36%|███▋      | 292/800 [12:54<19:47,  2.34s/it]\u001b[A\n",
      " 37%|███▋      | 293/800 [12:58<22:19,  2.64s/it]\u001b[A\n",
      " 37%|███▋      | 294/800 [13:01<24:08,  2.86s/it]\u001b[A\n",
      " 37%|███▋      | 295/800 [13:03<22:46,  2.71s/it]\u001b[A\n",
      " 37%|███▋      | 296/800 [13:07<23:58,  2.85s/it]\u001b[A\n",
      " 37%|███▋      | 297/800 [13:09<22:35,  2.70s/it]\u001b[A\n",
      " 37%|███▋      | 298/800 [13:11<21:35,  2.58s/it]\u001b[A\n",
      " 37%|███▋      | 299/800 [13:13<20:45,  2.49s/it]\u001b[A\n",
      " 38%|███▊      | 300/800 [13:17<22:58,  2.76s/it]\u001b[A\n",
      " 38%|███▊      | 301/800 [13:20<24:31,  2.95s/it]\u001b[A\n",
      " 38%|███▊      | 302/800 [13:24<25:41,  3.10s/it]\u001b[A\n",
      " 38%|███▊      | 303/800 [13:27<26:22,  3.18s/it]\u001b[A\n",
      " 38%|███▊      | 304/800 [13:30<26:58,  3.26s/it]\u001b[A\n",
      " 38%|███▊      | 305/800 [13:33<24:56,  3.02s/it]\u001b[A\n",
      " 38%|███▊      | 306/800 [13:36<25:06,  3.05s/it]\u001b[A\n",
      " 38%|███▊      | 307/800 [13:38<23:18,  2.84s/it]\u001b[A\n",
      " 38%|███▊      | 308/800 [13:40<21:25,  2.61s/it]\u001b[A\n",
      " 39%|███▊      | 309/800 [13:44<22:49,  2.79s/it]\u001b[A\n",
      " 39%|███▉      | 310/800 [13:46<21:22,  2.62s/it]\u001b[A\n",
      " 39%|███▉      | 311/800 [13:48<20:32,  2.52s/it]\u001b[A\n",
      " 39%|███▉      | 312/800 [13:50<19:47,  2.43s/it]\u001b[A\n",
      " 39%|███▉      | 313/800 [13:54<21:52,  2.69s/it]\u001b[A\n",
      " 39%|███▉      | 314/800 [13:56<20:32,  2.54s/it]\u001b[A\n",
      " 39%|███▉      | 315/800 [13:58<19:41,  2.44s/it]\u001b[A\n",
      " 40%|███▉      | 316/800 [14:00<19:11,  2.38s/it]\u001b[A\n",
      " 40%|███▉      | 317/800 [14:03<18:42,  2.32s/it]\u001b[A\n",
      " 40%|███▉      | 318/800 [14:06<20:56,  2.61s/it]\u001b[A\n",
      " 40%|███▉      | 319/800 [14:08<20:09,  2.52s/it]\u001b[A\n",
      " 40%|████      | 320/800 [14:10<19:41,  2.46s/it]\u001b[A\n",
      " 40%|████      | 321/800 [14:13<19:21,  2.43s/it]\u001b[A\n",
      " 40%|████      | 322/800 [14:15<18:53,  2.37s/it]\u001b[A\n",
      " 40%|████      | 323/800 [14:17<18:36,  2.34s/it]\u001b[A\n",
      " 40%|████      | 324/800 [14:20<18:20,  2.31s/it]\u001b[A\n",
      " 41%|████      | 325/800 [14:22<18:31,  2.34s/it]\u001b[A\n",
      " 41%|████      | 326/800 [14:24<18:03,  2.29s/it]\u001b[A\n",
      " 41%|████      | 327/800 [14:27<20:32,  2.61s/it]\u001b[A\n",
      " 41%|████      | 328/800 [14:31<22:35,  2.87s/it]\u001b[A\n",
      " 41%|████      | 329/800 [14:34<24:03,  3.06s/it]\u001b[A\n",
      " 41%|████▏     | 330/800 [14:38<24:31,  3.13s/it]\u001b[A\n",
      " 41%|████▏     | 331/800 [14:41<24:51,  3.18s/it]\u001b[A\n",
      " 42%|████▏     | 332/800 [14:43<22:33,  2.89s/it]\u001b[A\n",
      " 42%|████▏     | 333/800 [14:45<20:51,  2.68s/it]\u001b[A\n",
      " 42%|████▏     | 334/800 [14:49<22:11,  2.86s/it]\u001b[A\n",
      " 42%|████▏     | 335/800 [14:52<23:18,  3.01s/it]\u001b[A\n",
      " 42%|████▏     | 336/800 [14:54<21:35,  2.79s/it]\u001b[A\n",
      " 42%|████▏     | 337/800 [14:58<22:40,  2.94s/it]\u001b[A\n",
      " 42%|████▏     | 338/800 [15:01<23:21,  3.03s/it]\u001b[A\n",
      " 42%|████▏     | 339/800 [15:03<21:48,  2.84s/it]\u001b[A\n",
      " 42%|████▎     | 340/800 [15:06<22:33,  2.94s/it]\u001b[A\n",
      " 43%|████▎     | 341/800 [15:09<21:03,  2.75s/it]\u001b[A\n",
      " 43%|████▎     | 342/800 [15:11<19:48,  2.59s/it]\u001b[A\n",
      " 43%|████▎     | 343/800 [15:14<20:44,  2.72s/it]\u001b[A\n",
      " 43%|████▎     | 344/800 [15:16<19:35,  2.58s/it]\u001b[A\n",
      " 43%|████▎     | 345/800 [15:18<18:26,  2.43s/it]\u001b[A\n",
      " 43%|████▎     | 346/800 [15:21<17:58,  2.37s/it]\u001b[A\n",
      " 43%|████▎     | 347/800 [15:24<19:38,  2.60s/it]\u001b[A\n",
      " 44%|████▎     | 348/800 [15:26<18:40,  2.48s/it]\u001b[A\n",
      " 44%|████▎     | 349/800 [15:29<20:37,  2.74s/it]\u001b[A\n",
      " 44%|████▍     | 350/800 [15:33<21:45,  2.90s/it]\u001b[A\n",
      " 44%|████▍     | 351/800 [15:36<22:17,  2.98s/it]\u001b[A\n",
      " 44%|████▍     | 352/800 [15:39<22:27,  3.01s/it]\u001b[A\n",
      " 44%|████▍     | 353/800 [15:42<22:57,  3.08s/it]\u001b[A\n",
      " 44%|████▍     | 354/800 [15:44<21:07,  2.84s/it]\u001b[A\n",
      " 44%|████▍     | 355/800 [15:47<19:52,  2.68s/it]\u001b[A\n",
      " 44%|████▍     | 356/800 [15:50<20:49,  2.82s/it]\u001b[A\n",
      " 45%|████▍     | 357/800 [15:52<19:36,  2.66s/it]\u001b[A\n",
      " 45%|████▍     | 358/800 [15:54<18:10,  2.47s/it]\u001b[A\n",
      " 45%|████▍     | 359/800 [15:57<20:02,  2.73s/it]\u001b[A\n",
      " 45%|████▌     | 360/800 [16:00<19:10,  2.61s/it]\u001b[A\n",
      " 45%|████▌     | 361/800 [16:03<20:42,  2.83s/it]\u001b[A\n",
      " 45%|████▌     | 362/800 [16:06<21:41,  2.97s/it]\u001b[A\n",
      " 45%|████▌     | 363/800 [16:09<20:11,  2.77s/it]\u001b[A\n",
      " 46%|████▌     | 364/800 [16:11<19:01,  2.62s/it]\u001b[A\n",
      " 46%|████▌     | 365/800 [16:13<18:00,  2.48s/it]\u001b[A\n",
      " 46%|████▌     | 366/800 [16:15<17:18,  2.39s/it]\u001b[A\n",
      " 46%|████▌     | 367/800 [16:18<16:53,  2.34s/it]\u001b[A\n",
      " 46%|████▌     | 368/800 [16:21<19:02,  2.65s/it]\u001b[A\n",
      " 46%|████▌     | 369/800 [16:23<18:33,  2.58s/it]\u001b[A\n",
      " 46%|████▋     | 370/800 [16:26<17:45,  2.48s/it]\u001b[A\n",
      " 46%|████▋     | 371/800 [16:28<17:15,  2.41s/it]\u001b[A\n",
      " 46%|████▋     | 372/800 [16:30<16:40,  2.34s/it]\u001b[A\n",
      " 47%|████▋     | 373/800 [16:33<18:24,  2.59s/it]\u001b[A\n",
      " 47%|████▋     | 374/800 [16:35<17:42,  2.50s/it]\u001b[A\n",
      " 47%|████▋     | 375/800 [16:38<17:06,  2.42s/it]\u001b[A\n",
      " 47%|████▋     | 376/800 [16:40<16:42,  2.36s/it]\u001b[A\n",
      " 47%|████▋     | 377/800 [16:43<18:30,  2.63s/it]\u001b[A\n",
      " 47%|████▋     | 378/800 [16:45<17:38,  2.51s/it]\u001b[A\n",
      " 47%|████▋     | 379/800 [16:48<16:56,  2.41s/it]\u001b[A\n",
      " 48%|████▊     | 380/800 [16:50<16:28,  2.35s/it]\u001b[A\n",
      " 48%|████▊     | 381/800 [16:53<18:41,  2.68s/it]\u001b[A\n",
      " 48%|████▊     | 382/800 [16:55<17:34,  2.52s/it]\u001b[A\n",
      " 48%|████▊     | 383/800 [16:59<19:03,  2.74s/it]\u001b[A\n",
      " 48%|████▊     | 384/800 [17:01<18:03,  2.60s/it]\u001b[A\n",
      " 48%|████▊     | 385/800 [17:03<17:22,  2.51s/it]\u001b[A\n",
      " 48%|████▊     | 386/800 [17:05<16:52,  2.45s/it]\u001b[A\n",
      " 48%|████▊     | 387/800 [17:09<18:42,  2.72s/it]\u001b[A\n",
      " 48%|████▊     | 388/800 [17:11<17:44,  2.58s/it]\u001b[A\n",
      " 49%|████▊     | 389/800 [17:13<17:02,  2.49s/it]\u001b[A\n",
      " 49%|████▉     | 390/800 [17:17<18:27,  2.70s/it]\u001b[A\n",
      " 49%|████▉     | 391/800 [17:19<17:33,  2.57s/it]\u001b[A\n",
      " 49%|████▉     | 392/800 [17:21<16:52,  2.48s/it]\u001b[A\n",
      " 49%|████▉     | 393/800 [17:24<18:05,  2.67s/it]\u001b[A\n",
      " 49%|████▉     | 394/800 [17:26<16:59,  2.51s/it]\u001b[A\n",
      " 49%|████▉     | 395/800 [17:29<16:17,  2.41s/it]\u001b[A\n",
      " 50%|████▉     | 396/800 [17:32<18:15,  2.71s/it]\u001b[A\n",
      " 50%|████▉     | 397/800 [17:34<17:20,  2.58s/it]\u001b[A\n",
      " 50%|████▉     | 398/800 [17:37<18:33,  2.77s/it]\u001b[A\n",
      " 50%|████▉     | 399/800 [17:41<19:37,  2.94s/it]\u001b[A\n",
      " 50%|█████     | 400/800 [17:43<18:13,  2.73s/it]\u001b[A\n",
      " 50%|█████     | 401/800 [17:46<19:22,  2.91s/it]\u001b[A\n",
      " 50%|█████     | 402/800 [17:49<17:57,  2.71s/it]\u001b[A\n",
      " 50%|█████     | 403/800 [17:51<17:06,  2.59s/it]\u001b[A\n",
      " 50%|█████     | 404/800 [17:53<16:14,  2.46s/it]\u001b[A\n",
      " 51%|█████     | 405/800 [17:55<15:35,  2.37s/it]\u001b[A\n",
      " 51%|█████     | 406/800 [17:58<17:15,  2.63s/it]\u001b[A\n",
      " 51%|█████     | 407/800 [18:01<16:34,  2.53s/it]\u001b[A\n",
      " 51%|█████     | 408/800 [18:04<18:00,  2.76s/it]\u001b[A\n",
      " 51%|█████     | 409/800 [18:06<17:03,  2.62s/it]\u001b[A\n",
      " 51%|█████▏    | 410/800 [18:09<18:00,  2.77s/it]\u001b[A\n",
      " 51%|█████▏    | 411/800 [18:13<18:55,  2.92s/it]\u001b[A\n",
      " 52%|█████▏    | 412/800 [18:16<19:11,  2.97s/it]\u001b[A\n",
      " 52%|█████▏    | 413/800 [18:18<17:42,  2.74s/it]\u001b[A\n",
      " 52%|█████▏    | 414/800 [18:20<16:46,  2.61s/it]\u001b[A\n",
      " 52%|█████▏    | 415/800 [18:23<16:17,  2.54s/it]\u001b[A\n",
      " 52%|█████▏    | 416/800 [18:26<17:48,  2.78s/it]\u001b[A\n",
      " 52%|█████▏    | 417/800 [18:28<16:49,  2.64s/it]\u001b[A\n",
      " 52%|█████▏    | 418/800 [18:31<16:03,  2.52s/it]\u001b[A\n",
      " 52%|█████▏    | 419/800 [18:33<15:24,  2.43s/it]\u001b[A\n",
      " 52%|█████▎    | 420/800 [18:35<15:05,  2.38s/it]\u001b[A\n",
      " 53%|█████▎    | 421/800 [18:37<14:49,  2.35s/it]\u001b[A\n",
      " 53%|█████▎    | 422/800 [18:41<16:37,  2.64s/it]\u001b[A\n",
      " 53%|█████▎    | 423/800 [18:44<17:38,  2.81s/it]\u001b[A\n",
      " 53%|█████▎    | 424/800 [18:46<16:40,  2.66s/it]\u001b[A\n",
      " 53%|█████▎    | 425/800 [18:50<17:53,  2.86s/it]\u001b[A\n",
      " 53%|█████▎    | 426/800 [18:53<18:20,  2.94s/it]\u001b[A\n",
      " 53%|█████▎    | 427/800 [18:55<16:56,  2.73s/it]\u001b[A\n",
      " 54%|█████▎    | 428/800 [18:57<16:02,  2.59s/it]\u001b[A\n",
      " 54%|█████▎    | 429/800 [18:59<15:17,  2.47s/it]\u001b[A\n",
      " 54%|█████▍    | 430/800 [19:03<16:53,  2.74s/it]\u001b[A\n",
      " 54%|█████▍    | 431/800 [19:06<17:48,  2.90s/it]\u001b[A\n",
      " 54%|█████▍    | 432/800 [19:08<16:28,  2.69s/it]\u001b[A\n",
      " 54%|█████▍    | 433/800 [19:12<17:49,  2.91s/it]\u001b[A\n",
      " 54%|█████▍    | 434/800 [19:15<18:32,  3.04s/it]\u001b[A\n",
      " 54%|█████▍    | 435/800 [19:18<18:44,  3.08s/it]\u001b[A\n",
      " 55%|█████▍    | 436/800 [19:20<17:18,  2.85s/it]\u001b[A\n",
      " 55%|█████▍    | 437/800 [19:23<15:52,  2.62s/it]\u001b[A\n",
      " 55%|█████▍    | 438/800 [19:26<16:51,  2.79s/it]\u001b[A\n",
      " 55%|█████▍    | 439/800 [19:28<16:00,  2.66s/it]\u001b[A\n",
      " 55%|█████▌    | 440/800 [19:30<15:05,  2.52s/it]\u001b[A\n",
      " 55%|█████▌    | 441/800 [19:33<14:36,  2.44s/it]\u001b[A\n",
      " 55%|█████▌    | 442/800 [19:35<14:22,  2.41s/it]\u001b[A\n",
      " 55%|█████▌    | 443/800 [19:38<16:03,  2.70s/it]\u001b[A\n",
      " 56%|█████▌    | 444/800 [19:41<15:24,  2.60s/it]\u001b[A\n",
      " 56%|█████▌    | 445/800 [19:43<14:32,  2.46s/it]\u001b[A\n",
      " 56%|█████▌    | 446/800 [19:46<15:58,  2.71s/it]\u001b[A\n",
      " 56%|█████▌    | 447/800 [19:49<16:44,  2.85s/it]\u001b[A\n",
      " 56%|█████▌    | 448/800 [19:51<15:45,  2.69s/it]\u001b[A\n",
      " 56%|█████▌    | 449/800 [19:54<14:56,  2.56s/it]\u001b[A\n",
      " 56%|█████▋    | 450/800 [19:56<14:30,  2.49s/it]\u001b[A\n",
      " 56%|█████▋    | 451/800 [19:58<13:53,  2.39s/it]\u001b[A\n",
      " 56%|█████▋    | 452/800 [20:00<13:33,  2.34s/it]\u001b[A\n",
      " 57%|█████▋    | 453/800 [20:04<15:03,  2.60s/it]\u001b[A\n",
      " 57%|█████▋    | 454/800 [20:07<16:07,  2.80s/it]\u001b[A\n",
      " 57%|█████▋    | 455/800 [20:10<16:53,  2.94s/it]\u001b[A\n",
      " 57%|█████▋    | 456/800 [20:13<15:56,  2.78s/it]\u001b[A\n",
      " 57%|█████▋    | 457/800 [20:15<14:55,  2.61s/it]\u001b[A\n",
      " 57%|█████▋    | 458/800 [20:18<15:57,  2.80s/it]\u001b[A\n",
      " 57%|█████▋    | 459/800 [20:21<16:19,  2.87s/it]\u001b[A\n",
      " 57%|█████▊    | 460/800 [20:24<16:57,  2.99s/it]\u001b[A\n",
      " 58%|█████▊    | 461/800 [20:27<15:49,  2.80s/it]\u001b[A\n",
      " 58%|█████▊    | 462/800 [20:30<16:30,  2.93s/it]\u001b[A\n",
      " 58%|█████▊    | 463/800 [20:32<15:26,  2.75s/it]\u001b[A\n",
      " 58%|█████▊    | 464/800 [20:34<14:21,  2.56s/it]\u001b[A\n",
      " 58%|█████▊    | 465/800 [20:37<13:50,  2.48s/it]\u001b[A\n",
      " 58%|█████▊    | 466/800 [20:39<13:16,  2.38s/it]\u001b[A\n",
      " 58%|█████▊    | 467/800 [20:42<14:28,  2.61s/it]\u001b[A\n",
      " 58%|█████▊    | 468/800 [20:44<13:40,  2.47s/it]\u001b[A\n",
      " 59%|█████▊    | 469/800 [20:47<15:03,  2.73s/it]\u001b[A\n",
      " 59%|█████▉    | 470/800 [20:50<14:10,  2.58s/it]\u001b[A\n",
      " 59%|█████▉    | 471/800 [20:53<15:09,  2.76s/it]\u001b[A\n",
      " 59%|█████▉    | 472/800 [20:55<14:11,  2.60s/it]\u001b[A\n",
      " 59%|█████▉    | 473/800 [20:57<13:33,  2.49s/it]\u001b[A\n",
      " 59%|█████▉    | 474/800 [21:00<13:08,  2.42s/it]\u001b[A\n",
      " 59%|█████▉    | 475/800 [21:02<12:46,  2.36s/it]\u001b[A\n",
      " 60%|█████▉    | 476/800 [21:04<12:35,  2.33s/it]\u001b[A\n",
      " 60%|█████▉    | 477/800 [21:07<14:02,  2.61s/it]\u001b[A\n",
      " 60%|█████▉    | 478/800 [21:10<13:28,  2.51s/it]\u001b[A\n",
      " 60%|█████▉    | 479/800 [21:13<14:41,  2.75s/it]\u001b[A\n",
      " 60%|██████    | 480/800 [21:15<13:46,  2.58s/it]\u001b[A\n",
      " 60%|██████    | 481/800 [21:17<12:58,  2.44s/it]\u001b[A\n",
      " 60%|██████    | 482/800 [21:21<14:18,  2.70s/it]\u001b[A\n",
      " 60%|██████    | 483/800 [21:24<14:57,  2.83s/it]\u001b[A\n",
      " 60%|██████    | 484/800 [21:26<13:52,  2.63s/it]\u001b[A\n",
      " 61%|██████    | 485/800 [21:28<13:15,  2.52s/it]\u001b[A\n",
      " 61%|██████    | 486/800 [21:31<14:08,  2.70s/it]\u001b[A\n",
      " 61%|██████    | 487/800 [21:34<13:27,  2.58s/it]\u001b[A\n",
      " 61%|██████    | 488/800 [21:36<12:53,  2.48s/it]\u001b[A\n",
      " 61%|██████    | 489/800 [21:39<14:11,  2.74s/it]\u001b[A\n",
      " 61%|██████▏   | 490/800 [21:41<13:34,  2.63s/it]\u001b[A\n",
      " 61%|██████▏   | 491/800 [21:44<12:59,  2.52s/it]\u001b[A\n",
      " 62%|██████▏   | 492/800 [21:46<12:31,  2.44s/it]\u001b[A\n",
      " 62%|██████▏   | 493/800 [21:48<12:11,  2.38s/it]\u001b[A\n",
      " 62%|██████▏   | 494/800 [21:51<11:58,  2.35s/it]\u001b[A\n",
      " 62%|██████▏   | 495/800 [21:53<11:40,  2.30s/it]\u001b[A\n",
      " 62%|██████▏   | 496/800 [21:55<11:34,  2.29s/it]\u001b[A\n",
      " 62%|██████▏   | 497/800 [21:57<11:23,  2.26s/it]\u001b[A\n",
      " 62%|██████▏   | 498/800 [22:00<12:38,  2.51s/it]\u001b[A\n",
      " 62%|██████▏   | 499/800 [22:02<12:06,  2.41s/it]\u001b[A\n",
      " 62%|██████▎   | 500/800 [22:06<13:15,  2.65s/it]\u001b[A\n",
      " 63%|██████▎   | 501/800 [22:09<13:44,  2.76s/it]\u001b[A\n",
      " 63%|██████▎   | 502/800 [22:12<14:22,  2.89s/it]\u001b[A\n",
      " 63%|██████▎   | 503/800 [22:14<13:25,  2.71s/it]\u001b[A\n",
      " 63%|██████▎   | 504/800 [22:16<12:35,  2.55s/it]\u001b[A\n",
      " 63%|██████▎   | 505/800 [22:20<13:34,  2.76s/it]\u001b[A\n",
      " 63%|██████▎   | 506/800 [22:22<12:48,  2.61s/it]\u001b[A\n",
      " 63%|██████▎   | 507/800 [22:25<13:32,  2.77s/it]\u001b[A\n",
      " 64%|██████▎   | 508/800 [22:28<14:24,  2.96s/it]\u001b[A\n",
      " 64%|██████▎   | 509/800 [22:30<13:06,  2.70s/it]\u001b[A\n",
      " 64%|██████▍   | 510/800 [22:33<12:37,  2.61s/it]\u001b[A\n",
      " 64%|██████▍   | 511/800 [22:35<12:04,  2.51s/it]\u001b[A\n",
      " 64%|██████▍   | 512/800 [22:37<11:40,  2.43s/it]\u001b[A\n",
      " 64%|██████▍   | 513/800 [22:39<11:10,  2.34s/it]\u001b[A\n",
      " 64%|██████▍   | 514/800 [22:42<10:56,  2.30s/it]\u001b[A\n",
      " 64%|██████▍   | 515/800 [22:44<10:55,  2.30s/it]\u001b[A\n",
      " 64%|██████▍   | 516/800 [22:46<10:50,  2.29s/it]\u001b[A\n",
      " 65%|██████▍   | 517/800 [22:50<12:18,  2.61s/it]\u001b[A\n",
      " 65%|██████▍   | 518/800 [22:53<13:06,  2.79s/it]\u001b[A\n",
      " 65%|██████▍   | 519/800 [22:56<13:48,  2.95s/it]\u001b[A\n",
      " 65%|██████▌   | 520/800 [22:59<14:10,  3.04s/it]\u001b[A\n",
      " 65%|██████▌   | 521/800 [23:02<13:14,  2.85s/it]\u001b[A\n",
      " 65%|██████▌   | 522/800 [23:04<12:15,  2.65s/it]\u001b[A\n",
      " 65%|██████▌   | 523/800 [23:07<13:01,  2.82s/it]\u001b[A\n",
      " 66%|██████▌   | 524/800 [23:09<12:13,  2.66s/it]\u001b[A\n",
      " 66%|██████▌   | 525/800 [23:13<12:51,  2.81s/it]\u001b[A\n",
      " 66%|██████▌   | 526/800 [23:15<12:04,  2.64s/it]\u001b[A\n",
      " 66%|██████▌   | 527/800 [23:17<11:23,  2.50s/it]\u001b[A\n",
      " 66%|██████▌   | 528/800 [23:19<10:59,  2.42s/it]\u001b[A\n",
      " 66%|██████▌   | 529/800 [23:23<12:19,  2.73s/it]\u001b[A\n",
      " 66%|██████▋   | 530/800 [23:25<11:32,  2.57s/it]\u001b[A\n",
      " 66%|██████▋   | 531/800 [23:27<11:01,  2.46s/it]\u001b[A\n",
      " 66%|██████▋   | 532/800 [23:29<10:35,  2.37s/it]\u001b[A\n",
      " 67%|██████▋   | 533/800 [23:31<10:13,  2.30s/it]\u001b[A\n",
      " 67%|██████▋   | 534/800 [23:34<10:03,  2.27s/it]\u001b[A\n",
      " 67%|██████▋   | 535/800 [23:36<09:52,  2.24s/it]\u001b[A\n",
      " 67%|██████▋   | 536/800 [23:38<09:55,  2.26s/it]\u001b[A\n",
      " 67%|██████▋   | 537/800 [23:40<09:39,  2.20s/it]\u001b[A\n",
      " 67%|██████▋   | 538/800 [23:43<10:57,  2.51s/it]\u001b[A\n",
      " 67%|██████▋   | 539/800 [23:46<10:30,  2.42s/it]\u001b[A\n",
      " 68%|██████▊   | 540/800 [23:48<10:21,  2.39s/it]\u001b[A\n",
      " 68%|██████▊   | 541/800 [23:51<11:15,  2.61s/it]\u001b[A\n",
      " 68%|██████▊   | 542/800 [23:54<12:09,  2.83s/it]\u001b[A\n",
      " 68%|██████▊   | 543/800 [23:57<12:25,  2.90s/it]\u001b[A\n",
      " 68%|██████▊   | 544/800 [24:01<12:57,  3.04s/it]\u001b[A\n",
      " 68%|██████▊   | 545/800 [24:04<12:30,  2.94s/it]\u001b[A\n",
      " 68%|██████▊   | 546/800 [24:06<11:28,  2.71s/it]\u001b[A\n",
      " 68%|██████▊   | 547/800 [24:08<10:53,  2.58s/it]\u001b[A\n",
      " 68%|██████▊   | 548/800 [24:11<11:36,  2.77s/it]\u001b[A\n",
      " 69%|██████▊   | 549/800 [24:13<10:57,  2.62s/it]\u001b[A\n",
      " 69%|██████▉   | 550/800 [24:17<11:46,  2.83s/it]\u001b[A\n",
      " 69%|██████▉   | 551/800 [24:20<12:10,  2.94s/it]\u001b[A\n",
      " 69%|██████▉   | 552/800 [24:23<12:38,  3.06s/it]\u001b[A\n",
      " 69%|██████▉   | 553/800 [24:26<11:38,  2.83s/it]\u001b[A\n",
      " 69%|██████▉   | 554/800 [24:28<10:52,  2.65s/it]\u001b[A\n",
      " 69%|██████▉   | 555/800 [24:30<10:17,  2.52s/it]\u001b[A\n",
      " 70%|██████▉   | 556/800 [24:33<11:14,  2.76s/it]\u001b[A\n",
      " 70%|██████▉   | 557/800 [24:36<10:33,  2.61s/it]\u001b[A\n",
      " 70%|██████▉   | 558/800 [24:39<11:11,  2.77s/it]\u001b[A\n",
      " 70%|██████▉   | 559/800 [24:42<11:37,  2.89s/it]\u001b[A\n",
      " 70%|███████   | 560/800 [24:44<10:51,  2.71s/it]\u001b[A\n",
      " 70%|███████   | 561/800 [24:46<10:11,  2.56s/it]\u001b[A\n",
      " 70%|███████   | 562/800 [24:50<11:07,  2.80s/it]\u001b[A\n",
      " 70%|███████   | 563/800 [24:52<10:20,  2.62s/it]\u001b[A\n",
      " 70%|███████   | 564/800 [24:54<09:51,  2.51s/it]\u001b[A\n",
      " 71%|███████   | 565/800 [24:56<09:28,  2.42s/it]\u001b[A\n",
      " 71%|███████   | 566/800 [25:00<10:23,  2.66s/it]\u001b[A\n",
      " 71%|███████   | 567/800 [25:03<11:04,  2.85s/it]\u001b[A\n",
      " 71%|███████   | 568/800 [25:05<10:30,  2.72s/it]\u001b[A\n",
      " 71%|███████   | 569/800 [25:09<11:04,  2.88s/it]\u001b[A\n",
      " 71%|███████▏  | 570/800 [25:12<11:20,  2.96s/it]\u001b[A\n",
      " 71%|███████▏  | 571/800 [25:14<10:41,  2.80s/it]\u001b[A\n",
      " 72%|███████▏  | 572/800 [25:16<10:00,  2.63s/it]\u001b[A\n",
      " 72%|███████▏  | 573/800 [25:19<09:31,  2.52s/it]\u001b[A\n",
      " 72%|███████▏  | 574/800 [25:22<10:16,  2.73s/it]\u001b[A\n",
      " 72%|███████▏  | 575/800 [25:24<09:34,  2.56s/it]\u001b[A\n",
      " 72%|███████▏  | 576/800 [25:26<09:09,  2.45s/it]\u001b[A\n",
      " 72%|███████▏  | 577/800 [25:28<08:47,  2.36s/it]\u001b[A\n",
      " 72%|███████▏  | 578/800 [25:31<08:37,  2.33s/it]\u001b[A\n",
      " 72%|███████▏  | 579/800 [25:34<09:30,  2.58s/it]\u001b[A\n",
      " 72%|███████▎  | 580/800 [25:36<09:09,  2.50s/it]\u001b[A\n",
      " 73%|███████▎  | 581/800 [25:39<09:52,  2.71s/it]\u001b[A\n",
      " 73%|███████▎  | 582/800 [25:42<09:17,  2.56s/it]\u001b[A\n",
      " 73%|███████▎  | 583/800 [25:45<09:52,  2.73s/it]\u001b[A\n",
      " 73%|███████▎  | 584/800 [25:47<09:27,  2.63s/it]\u001b[A\n",
      " 73%|███████▎  | 585/800 [25:50<09:58,  2.78s/it]\u001b[A\n",
      " 73%|███████▎  | 586/800 [25:52<09:18,  2.61s/it]\u001b[A\n",
      " 73%|███████▎  | 587/800 [25:55<08:47,  2.48s/it]\u001b[A\n",
      " 74%|███████▎  | 588/800 [25:57<08:34,  2.43s/it]\u001b[A\n",
      " 74%|███████▎  | 589/800 [25:59<08:08,  2.31s/it]\u001b[A\n",
      " 74%|███████▍  | 590/800 [26:01<08:02,  2.30s/it]\u001b[A\n",
      " 74%|███████▍  | 591/800 [26:04<08:57,  2.57s/it]\u001b[A\n",
      " 74%|███████▍  | 592/800 [26:08<09:49,  2.84s/it]\u001b[A\n",
      " 74%|███████▍  | 593/800 [26:10<09:10,  2.66s/it]\u001b[A\n",
      " 74%|███████▍  | 594/800 [26:13<09:48,  2.86s/it]\u001b[A\n",
      " 74%|███████▍  | 595/800 [26:16<09:05,  2.66s/it]\u001b[A\n",
      " 74%|███████▍  | 596/800 [26:19<09:33,  2.81s/it]\u001b[A\n",
      " 75%|███████▍  | 597/800 [26:21<08:55,  2.64s/it]\u001b[A\n",
      " 75%|███████▍  | 598/800 [26:24<09:21,  2.78s/it]\u001b[A\n",
      " 75%|███████▍  | 599/800 [26:27<09:42,  2.90s/it]\u001b[A\n",
      " 75%|███████▌  | 600/800 [26:30<09:00,  2.70s/it]\u001b[A\n",
      " 75%|███████▌  | 601/800 [26:32<08:31,  2.57s/it]\u001b[A\n",
      " 75%|███████▌  | 602/800 [26:35<09:07,  2.76s/it]\u001b[A\n",
      " 75%|███████▌  | 603/800 [26:38<09:36,  2.93s/it]\u001b[A\n",
      " 76%|███████▌  | 604/800 [26:41<09:01,  2.76s/it]\u001b[A\n",
      " 76%|███████▌  | 605/800 [26:43<08:36,  2.65s/it]\u001b[A\n",
      " 76%|███████▌  | 606/800 [26:46<09:04,  2.81s/it]\u001b[A\n",
      " 76%|███████▌  | 607/800 [26:50<09:24,  2.92s/it]\u001b[A\n",
      " 76%|███████▌  | 608/800 [26:53<09:35,  3.00s/it]\u001b[A\n",
      " 76%|███████▌  | 609/800 [26:55<08:51,  2.78s/it]\u001b[A\n",
      " 76%|███████▋  | 610/800 [26:57<08:16,  2.61s/it]\u001b[A\n",
      " 76%|███████▋  | 611/800 [27:00<08:52,  2.82s/it]\u001b[A\n",
      " 76%|███████▋  | 612/800 [27:04<09:21,  2.98s/it]\u001b[A\n",
      " 77%|███████▋  | 613/800 [27:07<09:38,  3.09s/it]\u001b[A\n",
      " 77%|███████▋  | 614/800 [27:10<08:52,  2.86s/it]\u001b[A\n",
      " 77%|███████▋  | 615/800 [27:12<08:16,  2.69s/it]\u001b[A\n",
      " 77%|███████▋  | 616/800 [27:15<08:42,  2.84s/it]\u001b[A\n",
      " 77%|███████▋  | 617/800 [27:18<08:56,  2.93s/it]\u001b[A\n",
      " 77%|███████▋  | 618/800 [27:21<08:21,  2.76s/it]\u001b[A\n",
      " 77%|███████▋  | 619/800 [27:24<08:47,  2.92s/it]\u001b[A\n",
      " 78%|███████▊  | 620/800 [27:26<08:11,  2.73s/it]\u001b[A\n",
      " 78%|███████▊  | 621/800 [27:29<08:37,  2.89s/it]\u001b[A\n",
      " 78%|███████▊  | 622/800 [27:33<08:56,  3.02s/it]\u001b[A\n",
      " 78%|███████▊  | 623/800 [27:36<09:09,  3.10s/it]\u001b[A\n",
      " 78%|███████▊  | 624/800 [27:38<08:15,  2.81s/it]\u001b[A\n",
      " 78%|███████▊  | 625/800 [27:42<08:43,  2.99s/it]\u001b[A\n",
      " 78%|███████▊  | 626/800 [27:45<08:55,  3.08s/it]\u001b[A\n",
      " 78%|███████▊  | 627/800 [27:47<08:08,  2.83s/it]\u001b[A\n",
      " 78%|███████▊  | 628/800 [27:50<08:29,  2.96s/it]\u001b[A\n",
      " 79%|███████▊  | 629/800 [27:54<08:42,  3.06s/it]\u001b[A\n",
      " 79%|███████▉  | 630/800 [27:56<07:53,  2.78s/it]\u001b[A\n",
      " 79%|███████▉  | 631/800 [27:58<07:25,  2.64s/it]\u001b[A\n",
      " 79%|███████▉  | 632/800 [28:00<06:59,  2.50s/it]\u001b[A\n",
      " 79%|███████▉  | 633/800 [28:02<06:43,  2.42s/it]\u001b[A\n",
      " 79%|███████▉  | 634/800 [28:05<06:40,  2.41s/it]\u001b[A\n",
      " 79%|███████▉  | 635/800 [28:07<06:26,  2.35s/it]\u001b[A\n",
      " 80%|███████▉  | 636/800 [28:09<06:13,  2.28s/it]\u001b[A\n",
      " 80%|███████▉  | 637/800 [28:11<06:09,  2.27s/it]\u001b[A\n",
      " 80%|███████▉  | 638/800 [28:14<06:09,  2.28s/it]\u001b[A\n",
      " 80%|███████▉  | 639/800 [28:17<06:40,  2.49s/it]\u001b[A\n",
      " 80%|████████  | 640/800 [28:19<06:25,  2.41s/it]\u001b[A\n",
      " 80%|████████  | 641/800 [28:21<06:24,  2.42s/it]\u001b[A\n",
      " 80%|████████  | 642/800 [28:25<07:00,  2.66s/it]\u001b[A\n",
      " 80%|████████  | 643/800 [28:27<06:41,  2.55s/it]\u001b[A\n",
      " 80%|████████  | 644/800 [28:30<07:12,  2.77s/it]\u001b[A\n",
      " 81%|████████  | 645/800 [28:32<06:49,  2.64s/it]\u001b[A\n",
      " 81%|████████  | 646/800 [28:35<06:26,  2.51s/it]\u001b[A\n",
      " 81%|████████  | 647/800 [28:38<06:57,  2.73s/it]\u001b[A\n",
      " 81%|████████  | 648/800 [28:41<07:14,  2.86s/it]\u001b[A\n",
      " 81%|████████  | 649/800 [28:44<07:30,  2.99s/it]\u001b[A\n",
      " 81%|████████▏ | 650/800 [28:47<06:56,  2.77s/it]\u001b[A\n",
      " 81%|████████▏ | 651/800 [28:50<07:12,  2.90s/it]\u001b[A\n",
      " 82%|████████▏ | 652/800 [28:52<06:37,  2.68s/it]\u001b[A\n",
      " 82%|████████▏ | 653/800 [28:54<06:10,  2.52s/it]\u001b[A\n",
      " 82%|████████▏ | 654/800 [28:57<06:37,  2.72s/it]\u001b[A\n",
      " 82%|████████▏ | 655/800 [29:00<06:15,  2.59s/it]\u001b[A\n",
      " 82%|████████▏ | 656/800 [29:02<05:58,  2.49s/it]\u001b[A\n",
      " 82%|████████▏ | 657/800 [29:04<05:38,  2.36s/it]\u001b[A\n",
      " 82%|████████▏ | 658/800 [29:07<06:20,  2.68s/it]\u001b[A\n",
      " 82%|████████▏ | 659/800 [29:10<06:01,  2.56s/it]\u001b[A\n",
      " 82%|████████▎ | 660/800 [29:12<05:45,  2.47s/it]\u001b[A\n",
      " 83%|████████▎ | 661/800 [29:15<06:16,  2.71s/it]\u001b[A\n",
      " 83%|████████▎ | 662/800 [29:18<05:57,  2.59s/it]\u001b[A\n",
      " 83%|████████▎ | 663/800 [29:21<06:16,  2.75s/it]\u001b[A\n",
      " 83%|████████▎ | 664/800 [29:23<05:56,  2.62s/it]\u001b[A\n",
      " 83%|████████▎ | 665/800 [29:25<05:44,  2.55s/it]\u001b[A\n",
      " 83%|████████▎ | 666/800 [29:29<06:12,  2.78s/it]\u001b[A\n",
      " 83%|████████▎ | 667/800 [29:31<05:47,  2.61s/it]\u001b[A\n",
      " 84%|████████▎ | 668/800 [29:33<05:30,  2.50s/it]\u001b[A\n",
      " 84%|████████▎ | 669/800 [29:36<05:57,  2.73s/it]\u001b[A\n",
      " 84%|████████▍ | 670/800 [29:40<06:15,  2.89s/it]\u001b[A\n",
      " 84%|████████▍ | 671/800 [29:43<06:26,  2.99s/it]\u001b[A\n",
      " 84%|████████▍ | 672/800 [29:46<06:31,  3.06s/it]\u001b[A\n",
      " 84%|████████▍ | 673/800 [29:49<06:33,  3.10s/it]\u001b[A\n",
      " 84%|████████▍ | 674/800 [29:52<05:58,  2.84s/it]\u001b[A\n",
      " 84%|████████▍ | 675/800 [29:54<05:33,  2.66s/it]\u001b[A\n",
      " 84%|████████▍ | 676/800 [29:57<05:50,  2.83s/it]\u001b[A\n",
      " 85%|████████▍ | 677/800 [29:59<05:22,  2.62s/it]\u001b[A\n",
      " 85%|████████▍ | 678/800 [30:02<05:45,  2.84s/it]\u001b[A\n",
      " 85%|████████▍ | 679/800 [30:06<05:58,  2.96s/it]\u001b[A\n",
      " 85%|████████▌ | 680/800 [30:09<06:06,  3.05s/it]\u001b[A\n",
      " 85%|████████▌ | 681/800 [30:11<05:34,  2.81s/it]\u001b[A\n",
      " 85%|████████▌ | 682/800 [30:14<05:45,  2.93s/it]\u001b[A\n",
      " 85%|████████▌ | 683/800 [30:18<05:57,  3.05s/it]\u001b[A\n",
      " 86%|████████▌ | 684/800 [30:20<05:23,  2.79s/it]\u001b[A\n",
      " 86%|████████▌ | 685/800 [30:23<05:35,  2.92s/it]\u001b[A\n",
      " 86%|████████▌ | 686/800 [30:26<05:42,  3.00s/it]\u001b[A\n",
      " 86%|████████▌ | 687/800 [30:29<05:15,  2.79s/it]\u001b[A\n",
      " 86%|████████▌ | 688/800 [30:32<05:23,  2.89s/it]\u001b[A\n",
      " 86%|████████▌ | 689/800 [30:35<05:35,  3.02s/it]\u001b[A\n",
      " 86%|████████▋ | 690/800 [30:38<05:42,  3.11s/it]\u001b[A\n",
      " 86%|████████▋ | 691/800 [30:41<05:10,  2.85s/it]\u001b[A\n",
      " 86%|████████▋ | 692/800 [30:43<04:50,  2.69s/it]\u001b[A\n",
      " 87%|████████▋ | 693/800 [30:45<04:30,  2.53s/it]\u001b[A\n",
      " 87%|████████▋ | 694/800 [30:47<04:19,  2.45s/it]\u001b[A\n",
      " 87%|████████▋ | 695/800 [30:50<04:09,  2.38s/it]\u001b[A\n",
      " 87%|████████▋ | 696/800 [30:52<04:04,  2.35s/it]\u001b[A\n",
      " 87%|████████▋ | 697/800 [30:54<03:53,  2.26s/it]\u001b[A\n",
      " 87%|████████▋ | 698/800 [30:56<03:46,  2.22s/it]\u001b[A\n",
      " 87%|████████▋ | 699/800 [31:00<04:20,  2.58s/it]\u001b[A\n",
      " 88%|████████▊ | 700/800 [31:02<04:09,  2.50s/it]\u001b[A\n",
      " 88%|████████▊ | 701/800 [31:05<04:31,  2.74s/it]\u001b[A\n",
      " 88%|████████▊ | 702/800 [31:08<04:40,  2.86s/it]\u001b[A\n",
      " 88%|████████▊ | 703/800 [31:11<04:22,  2.71s/it]\u001b[A\n",
      " 88%|████████▊ | 704/800 [31:13<04:07,  2.58s/it]\u001b[A\n",
      " 88%|████████▊ | 705/800 [31:15<03:52,  2.45s/it]\u001b[A\n",
      " 88%|████████▊ | 706/800 [31:17<03:43,  2.37s/it]\u001b[A\n",
      " 88%|████████▊ | 707/800 [31:21<04:10,  2.69s/it]\u001b[A\n",
      " 88%|████████▊ | 708/800 [31:23<03:55,  2.56s/it]\u001b[A\n",
      " 89%|████████▊ | 709/800 [31:25<03:41,  2.43s/it]\u001b[A\n",
      " 89%|████████▉ | 710/800 [31:27<03:34,  2.38s/it]\u001b[A\n",
      " 89%|████████▉ | 711/800 [31:30<03:28,  2.34s/it]\u001b[A\n",
      " 89%|████████▉ | 712/800 [31:32<03:22,  2.30s/it]\u001b[A\n",
      " 89%|████████▉ | 713/800 [31:34<03:19,  2.29s/it]\u001b[A\n",
      " 89%|████████▉ | 714/800 [31:36<03:15,  2.27s/it]\u001b[A\n",
      " 89%|████████▉ | 715/800 [31:39<03:12,  2.26s/it]\u001b[A\n",
      " 90%|████████▉ | 716/800 [31:41<03:09,  2.25s/it]\u001b[A\n",
      " 90%|████████▉ | 717/800 [31:44<03:28,  2.52s/it]\u001b[A\n",
      " 90%|████████▉ | 718/800 [31:46<03:19,  2.43s/it]\u001b[A\n",
      " 90%|████████▉ | 719/800 [31:48<03:15,  2.41s/it]\u001b[A\n",
      " 90%|█████████ | 720/800 [31:51<03:07,  2.34s/it]\u001b[A\n",
      " 90%|█████████ | 721/800 [31:54<03:27,  2.62s/it]\u001b[A\n",
      " 90%|█████████ | 722/800 [31:56<03:16,  2.52s/it]\u001b[A\n",
      " 90%|█████████ | 723/800 [31:59<03:29,  2.72s/it]\u001b[A\n",
      " 90%|█████████ | 724/800 [32:02<03:14,  2.56s/it]\u001b[A\n",
      " 91%|█████████ | 725/800 [32:05<03:23,  2.71s/it]\u001b[A\n",
      " 91%|█████████ | 726/800 [32:08<03:32,  2.87s/it]\u001b[A\n",
      " 91%|█████████ | 727/800 [32:10<03:18,  2.72s/it]\u001b[A\n",
      " 91%|█████████ | 728/800 [32:13<03:25,  2.86s/it]\u001b[A\n",
      " 91%|█████████ | 729/800 [32:16<03:10,  2.68s/it]\u001b[A\n",
      " 91%|█████████▏| 730/800 [32:18<02:56,  2.52s/it]\u001b[A\n",
      " 91%|█████████▏| 731/800 [32:21<03:09,  2.75s/it]\u001b[A\n",
      " 92%|█████████▏| 732/800 [32:24<03:14,  2.87s/it]\u001b[A\n",
      " 92%|█████████▏| 733/800 [32:27<02:59,  2.68s/it]\u001b[A\n",
      " 92%|█████████▏| 734/800 [32:29<02:46,  2.52s/it]\u001b[A\n",
      " 92%|█████████▏| 735/800 [32:32<03:00,  2.78s/it]\u001b[A\n",
      " 92%|█████████▏| 736/800 [32:36<03:11,  2.99s/it]\u001b[A\n",
      " 92%|█████████▏| 737/800 [32:38<02:55,  2.78s/it]\u001b[A\n",
      " 92%|█████████▏| 738/800 [32:40<02:43,  2.64s/it]\u001b[A\n",
      " 92%|█████████▏| 739/800 [32:42<02:32,  2.50s/it]\u001b[A\n",
      " 92%|█████████▎| 740/800 [32:45<02:25,  2.42s/it]\u001b[A\n",
      " 93%|█████████▎| 741/800 [32:47<02:20,  2.37s/it]\u001b[A\n",
      " 93%|█████████▎| 742/800 [32:50<02:33,  2.65s/it]\u001b[A\n",
      " 93%|█████████▎| 743/800 [32:52<02:22,  2.50s/it]\u001b[A\n",
      " 93%|█████████▎| 744/800 [32:55<02:31,  2.71s/it]\u001b[A\n",
      " 93%|█████████▎| 745/800 [32:58<02:22,  2.60s/it]\u001b[A\n",
      " 93%|█████████▎| 746/800 [33:00<02:13,  2.48s/it]\u001b[A\n",
      " 93%|█████████▎| 747/800 [33:02<02:08,  2.43s/it]\u001b[A\n",
      " 94%|█████████▎| 748/800 [33:06<02:20,  2.70s/it]\u001b[A\n",
      " 94%|█████████▎| 749/800 [33:08<02:10,  2.56s/it]\u001b[A\n",
      " 94%|█████████▍| 750/800 [33:10<02:04,  2.49s/it]\u001b[A\n",
      " 94%|█████████▍| 751/800 [33:12<01:57,  2.39s/it]\u001b[A\n",
      " 94%|█████████▍| 752/800 [33:16<02:05,  2.62s/it]\u001b[A\n",
      " 94%|█████████▍| 753/800 [33:18<01:58,  2.52s/it]\u001b[A\n",
      " 94%|█████████▍| 754/800 [33:20<01:53,  2.47s/it]\u001b[A\n",
      " 94%|█████████▍| 755/800 [33:24<02:02,  2.73s/it]\u001b[A\n",
      " 94%|█████████▍| 756/800 [33:26<01:54,  2.60s/it]\u001b[A\n",
      " 95%|█████████▍| 757/800 [33:29<01:59,  2.78s/it]\u001b[A\n",
      " 95%|█████████▍| 758/800 [33:31<01:50,  2.63s/it]\u001b[A\n",
      " 95%|█████████▍| 759/800 [33:33<01:42,  2.49s/it]\u001b[A\n",
      " 95%|█████████▌| 760/800 [33:37<01:49,  2.75s/it]\u001b[A\n",
      " 95%|█████████▌| 761/800 [33:40<01:52,  2.87s/it]\u001b[A\n",
      " 95%|█████████▌| 762/800 [33:42<01:42,  2.69s/it]\u001b[A\n",
      " 95%|█████████▌| 763/800 [33:44<01:33,  2.52s/it]\u001b[A\n",
      " 96%|█████████▌| 764/800 [33:47<01:28,  2.46s/it]\u001b[A\n",
      " 96%|█████████▌| 765/800 [33:50<01:32,  2.64s/it]\u001b[A\n",
      " 96%|█████████▌| 766/800 [33:53<01:36,  2.83s/it]\u001b[A\n",
      " 96%|█████████▌| 767/800 [33:56<01:39,  3.00s/it]\u001b[A\n",
      " 96%|█████████▌| 768/800 [33:59<01:29,  2.80s/it]\u001b[A\n",
      " 96%|█████████▌| 769/800 [34:02<01:31,  2.97s/it]\u001b[A\n",
      " 96%|█████████▋| 770/800 [34:05<01:31,  3.06s/it]\u001b[A\n",
      " 96%|█████████▋| 771/800 [34:09<01:30,  3.14s/it]\u001b[A\n",
      " 96%|█████████▋| 772/800 [34:11<01:20,  2.88s/it]\u001b[A\n",
      " 97%|█████████▋| 773/800 [34:13<01:12,  2.69s/it]\u001b[A\n",
      " 97%|█████████▋| 774/800 [34:16<01:14,  2.87s/it]\u001b[A\n",
      " 97%|█████████▋| 775/800 [34:19<01:06,  2.65s/it]\u001b[A\n",
      " 97%|█████████▋| 776/800 [34:22<01:07,  2.83s/it]\u001b[A\n",
      " 97%|█████████▋| 777/800 [34:24<01:00,  2.61s/it]\u001b[A\n",
      " 97%|█████████▋| 778/800 [34:26<00:54,  2.49s/it]\u001b[A\n",
      " 97%|█████████▋| 779/800 [34:29<00:56,  2.70s/it]\u001b[A\n",
      " 98%|█████████▊| 780/800 [34:32<00:51,  2.55s/it]\u001b[A\n",
      " 98%|█████████▊| 781/800 [34:35<00:52,  2.77s/it]\u001b[A\n",
      " 98%|█████████▊| 782/800 [34:37<00:47,  2.63s/it]\u001b[A\n",
      " 98%|█████████▊| 783/800 [34:39<00:42,  2.51s/it]\u001b[A\n",
      " 98%|█████████▊| 784/800 [34:42<00:38,  2.41s/it]\u001b[A\n",
      " 98%|█████████▊| 785/800 [34:44<00:36,  2.40s/it]\u001b[A\n",
      " 98%|█████████▊| 786/800 [34:46<00:32,  2.34s/it]\u001b[A\n",
      " 98%|█████████▊| 787/800 [34:48<00:30,  2.33s/it]\u001b[A\n",
      " 98%|█████████▊| 788/800 [34:52<00:31,  2.66s/it]\u001b[A\n",
      " 99%|█████████▊| 789/800 [34:54<00:28,  2.56s/it]\u001b[A\n",
      " 99%|█████████▉| 790/800 [34:56<00:24,  2.42s/it]\u001b[A\n",
      " 99%|█████████▉| 791/800 [34:59<00:21,  2.40s/it]\u001b[A\n",
      " 99%|█████████▉| 792/800 [35:02<00:20,  2.62s/it]\u001b[A\n",
      " 99%|█████████▉| 793/800 [35:05<00:19,  2.82s/it]\u001b[A\n",
      " 99%|█████████▉| 794/800 [35:08<00:17,  3.00s/it]\u001b[A\n",
      " 99%|█████████▉| 795/800 [35:11<00:13,  2.78s/it]\u001b[A\n",
      "100%|█████████▉| 796/800 [35:14<00:11,  2.93s/it]\u001b[A\n",
      "100%|█████████▉| 797/800 [35:16<00:08,  2.70s/it]\u001b[A\n",
      "100%|█████████▉| 798/800 [35:20<00:05,  2.89s/it]\u001b[A\n",
      "100%|█████████▉| 799/800 [35:22<00:02,  2.68s/it]\u001b[A\n",
      "100%|██████████| 800/800 [35:24<00:00,  2.49s/it]\u001b[A"
     ]
    }
   ],
   "source": [
    "for f in tqdm.tqdm(file_list):\n",
    "    data_files = []\n",
    "    affine = None\n",
    "    for path in predict_paths:\n",
    "        full_path = os.path.join(path, f)\n",
    "        handle = nii.load(full_path)\n",
    "        affine = handle.affine\n",
    "        data_files.append(handle.get_data())\n",
    "    \n",
    "    mean_predict = sum(data_files) / len(data_files)\n",
    "    \n",
    "    hard_predict = np.argmax(mean_predict,axis=0).astype(np.uint8)\n",
    "    hard_predict[hard_predict == 3] = 4\n",
    "    \n",
    "    nii_output = nii.Nifti1Image(hard_predict, affine)\n",
    "    nii.save(nii_output, os.path.join(output_path,f))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
